# Command line arguments parsing
buildsender = 1
cppdefines = []
for key, value in ARGLIST:
    if key == 'define' and value == 'SEND':
        print "===> Building " + value
        cppdefines.append('SEND')
        builsender = 1
    elif key == 'define' and value == 'RECV' :
        cppdefines.append('RECV');
        buildsender = 0

env = Environment(CC = 'g++')
env.Append(CPPPATH = ['../../include/'])
env.Append(LIBS = ['netfilter_queue'])
env.ParseConfig('pkg-config --cflags --libs libpjproject')
env.ParseConfig('xml2-config --cflags --libs')

dbg = Environment(CC = 'g++', CCFLAGS = '-ggdb', CPPDEFINES = cppdefines)
dbg.Append(CPPPATH = ['../../include/', '/usr/local/include/'])
dbg.Append(LIBS = ['netfilter_queue'])
dbg.ParseConfig('pkg-config --libs libpjproject')
dbg.ParseConfig('xml2-config --cflags --libs')
dbg.ParseConfig('pkg-config --cflags --libs sigc++-2.0')


object_list = dbg.Object(source = ['sip_test_2.cpp'])
object_list.append('../../build/sip/common.o')
object_list.append('../../build/sip/inout.o')
object_list.append('../../build/rtp/rtp.o')
object_list.append('../../build/rtp/mgr.o')
object_list.append('../../build/net.o')
object_list.append('../../build/netfilter.o')
object_list.append('../../build/logger.o')
object_list.append('../../build/terminal.o')
object_list.append('../../build/utils.o')
object_list.append('../../build/lib/md5/md5.o')
object_list.append('../../build/config.o')
object_list.append('../../build/databank.o')

if buildsender == 1 :
	object_list.append('../../build/rtp/send.o')
else :
	object_list.append('../../build/rtp/recv.o')

dbg.Program(target='exe_sip_test_2', source = object_list)
